package iws.g5.uebung3.gui;

import iws.g5.uebung3.StateModel;
import iws.g5.uebung3.enums.OrganicType;
import iws.g5.uebung3.interfaces.OrganicObject;

public class GuiConsole implements Display {

	@Override
	public void drawEnvironment(StateModel env){
		for(int i=0;i<env.getXDimension();i++){
			System.out.print("--");
		}
		System.out.print("\n");
		for(int y=0;y<env.getYDimension();y++){
			for(int x=0;x<env.getXDimension();x++){
				OrganicObject object=env.getOrganicObject(x, y);
				if(object==null){
					System.out.print("| ");
				}else if(object.getType()==OrganicType.CELL){
					System.out.print("|c");
				}else{
					System.out.print("|f");
				}
			}
			System.out.print("|\n");
			for(int i=0;i<env.getXDimension();i++){
				System.out.print("--");
			}
			System.out.print("\n");
		}
		System.out.print("\n\n\n\n");
	}
}
